package 剑指offer.Month7_07.day17;

public class 翻转单词序列 {
    public String ReverseSentence(String str) {
        String[] arr = str.split(" ");
        StringBuilder myStr = new StringBuilder();
        for (int i = arr.length- 1; i >= 0; i--) {
            myStr.append(arr[i]);
            if(i != 0) myStr.append(" ");
        }
        return myStr.toString();
    }
}
